package Chapter04;

import java.util.Scanner;

public class Zuoye0 {
    public static void main(String[] args) {
        Scanner input =new Scanner(System.in);
        System.out.println("请输入购物金额:");
        double money =input.nextDouble();
        int sum =input.nextInt();
        switch (sum){
            case 0:
                System.out.println("不换购，应支付:"+money);
                break;
            case 1:
                if (money >=50){
                    System.out.println("换购500毫升可乐,应支付:"+(money+1));
                }else{
                    System.out.println("购物金额不走,无法换购");
                }
                break;
            case 2:
                if(money >=100){
                    System.out.println("换购1000毫升果汁,应支付:"+(money+2));
                }else{
                    System.out.println("购物金额不走,无法换购");
                }
                break;
            case 3:
                if (money >=100){
                    System.out.println("换购一壶炫迈口香糖，应支付："+(money+4));
                }else {
                    System.out.println("购物金额不走,无法换购");
                }
                break;
            case 4:
                if (money >=200){
                    System.out.println("换购一瓶进口红酒，应支付："+(money+38));
                }else {
                    System.out.println("购物金额不走,无法换购");
                }
                break;
            case 5:
                if (money >=200){
                    System.out.println("换购一袋面粉，应支付："+(money+15));
                }else {
                    System.out.println("购物金额不走,无法换购");
                }
                break;
                default:
                    System.out.println("输入错误");
        }
    }
}
